package life;

// 递归判断最大值
public class T {
    public static void main(String[] args) {
        int[] a = {1, 5, 3};
        System.out.println(max(a, 0));

    }

    private static int max(int[] a, int index) {
        if (index == a.length - 1) {
            return a[index];
        }
        return Math.max(a[index], max(a, index + 1));
    }
}
